/*
@Project:SpringBoot
@Date:2023/3/20
@FileName:CommentMapper.java
@Create:Ya Potato
@IDE:IntelliJ IDEA 2023.1
@version:JDK 1.8
*/

package com.itheima.mapper;
import com.itheima.domain.Comment;
import org.apache.ibatis.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;


@Mapper
public interface CommentMapper {
    @Select("SELECT * FROM t_comment WHERE id = #{id}")
    public Comment findById(Integer id);

    @Insert("insert into t_comment (content, author, a_id) values (#{content}, #{author}, #{aId})")
    public int insertComment(Comment comment);

    @Update("update t_comment set content=#{content} where id =#{id}")
    public int updateComment (Comment comment);

    @Delete("delete from t_comment where id =#{id}")
    public int deleteComment(Integer id);
}
